function clazzNameFormatter(cellVal,cellConfig,rowData){
	if(!$.isEmptyObject(rowData) && !$.isEmptyObject(rowData.clazz)){
		if(!$.StringUtils.isEmpty(rowData.clazz.clazzName)){
			return rowData.clazz.clazzName;
		}
	}
	return $.StringUtils.isEmpty(cellVal)?"":cellVal;
}

function clazzNumFormatter(cellVal,cellConfig,rowData){
	if(!$.isEmptyObject(rowData) && !$.isEmptyObject(rowData.clazz)){
		if(!$.StringUtils.isEmpty(rowData.clazz.clazzNum)){
			return rowData.clazz.clazzNum;
		}
	}
	return $.StringUtils.isEmpty(cellVal)?"":cellVal;
}
$(window).ready(function(){
	
	//对下拉框赋值
	var dwrOption = {
		async:false,
		callback:function(result){
			$.SelectUtils.setOptions(result,{
				selector : "#editClazzNum",
				valueTextMap : {textKey : "clazzNum",valueKey : "clazzNum"},
				addData:true});
		}
	}
	CommonService.loadAll('com.wef.demo.entity.Clazz',$.DwrUtils.proDwrOption(dwrOption));
	//对下拉框绑定事件
	$("#editClazzNum").bind('change',function(){
		//获取下拉框当前选中的数据
		var selData = $.SelectUtils.getSelectedOptionDatas("#editClazzNum")[0];
		
		//获取当前正在编辑的ID值
		var editRowId = $('#tableStudent').jqGrid("getCurrentSelectRowId");
		//获取当前正在编辑的rowData
		var editRowData = $('#tableStudent').jqGrid("getRowDataById",editRowId);
		//对当前正在编辑的rowData,的父属性(对象属性:clazz)赋值
		$('#tableStudent').jqGrid('setRowData',editRowId,$.extend({},editRowData,{"clazz":selData}));
	})
});

function afterSelectRow4EditClazzName(rowData){
	//获取当前正在编辑的ID值
	var editRowId = $('#tableStudent').jqGrid("getCurrentSelectRowId");
	//获取当前正在编辑的rowData
	var editRowData = $('#tableStudent').jqGrid("getRowDataById",editRowId);
	//对当前正在编辑的rowData,的父属性(对象属性:clazz)赋值
	$('#tableStudent').jqGrid('setRowData',editRowId,$.extend({},editRowData,{"clazz":rowData}));
}